﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XrmLibrary.MsCrm4Adapter.Extensions
{
    public static class TraceInfoExtensions
    {
        public static Microsoft.Crm.Sdk.Messages.TraceInfo ToCrm2011TraceInfo(this Microsoft.Crm.Sdk.TraceInfo crm4TraceInfo)
        {
            Microsoft.Crm.Sdk.Messages.TraceInfo crm2011TraceInfo =
                new Microsoft.Crm.Sdk.Messages.TraceInfo
                {
                    ErrorInfoList = crm4TraceInfo.ErrorInfoList.ToCrm2011ErrorInfoCollection().ToArray<Microsoft.Crm.Sdk.Messages.ErrorInfo>()
                };

            return crm2011TraceInfo;
        }
    }
}
